package com.translate.web.constant;

/**
 * token区间长度
 * 
 * @author 111
 *
 */
public enum TokenIntervalLength {

	ORDINARY("com.fingerstar.manager.service.IOrderService", 1, 1000000),
	
	BLIND_BOX("com.fingerstar.manager.service.IBlindOrderService", 1000001, 2000000),
	
	;

	private String tag;

	private long start;

	private long end;

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public long getStart() {
		return start;
	}

	public void setStart(long start) {
		this.start = start;
	}

	public long getEnd() {
		return end;
	}

	public void setEnd(long end) {
		this.end = end;
	}

	private TokenIntervalLength(String tag, long start, long end) {
		this.tag = tag;
		
		this.start = start;

		this.end = end;
	}

	
	public static String getGoodsType(long tokenId) {
		
		if (ORDINARY.start <= tokenId  && ORDINARY.end >= tokenId) {
			return ORDINARY.tag;
		} else if (BLIND_BOX.start <= tokenId  && BLIND_BOX.end >= tokenId) {
			return BLIND_BOX.tag;
		}
		return "";
	}
}